<template>
    <div>
        <van-nav-bar
            title="资料消息"
            left-arrow
            @click-left="onClickLeft"
        />
        <div class="logins">
            <img src="https://caiba-produce.oss-cn-beijing.aliyuncs.com//static/upload/83fab6c9ce43bc0203d93b786237cf2c/apply/20200813/user.png" alt="" class="userIcon">
            <div class="title">
                {{name}}
            </div>
            <span @click="linkTo">编辑</span>
        </div>
        <van-cell title="收货地址" is-link />
        <van-cell title="用户反馈" is-link />
        <van-cell title="关于我们" value="v1.0.26" />
        <van-cell title="切换账号" is-link @click="handleshow" />
        <van-dialog 
            v-model="show"  
            show-cancel-button
            message="是否切换账号"
            @confirm="handleOut"
        >
        </van-dialog>
        <van-button 
            round type="info"
            size="large"
            :plain="true"
            color="#df2321"
            @click="handleOut"
        >
            退出登录
        </van-button>
        <div class="fiexd">
            <span>服务协议</span>
            <div class="van-hairline--left"></div>
                <span>隐私政策</span>
        </div>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                show: false,
                name:'',
            };
        },
        methods: {
            onClickLeft() {
                this.$router.go(-1);
            },
            handleshow(){
                this.show = true
            },
            linkTo(){
                this.$router.push({path:'/editing'})
            },
            handleOut(){
                localStorage.removeItem('name')
                this.$router.push('/login')
            }
        },
        created () {
            this.name = localStorage.getItem('name');
        },
    }
</script>

<style scoped src="../../assets/css/Set.css">

</style>